home *** CD-ROM | disk | FTP | other *** search
/ Monster Media 1996 #15 / Monster Media Number 15 (Monster Media)(July 1996).ISO / prog_c / cuj0696.zip / DWYER.ZIP / RUN.TST / RUNDEFS.H < prev    next >
C/C++ Source or Header  |  1996-01-05  |  2KB  |  61 lines

  1. /* ============ */
  2. /* runsdefs.h    */
  3. /* ============ */
  4. /* ==================================================================== */
  5. /*        TYPEDEFS AND DEFINED MACROS FOR RUNS FUNCTIONS        */
  6. /* ==================================================================== */
  7. # if defined(__RUNSDEFS_H__)
  8. #        /* Do Nothing. */
  9. # else
  10. # if !defined(__DEFCODES)
  11.  
  12. typedef    unsigned char        UCHAR;
  13. typedef    unsigned int        UINT;
  14.  
  15. #define    FALSE    0
  16. #define    TRUE    1
  17. # endif
  18.  
  19. #define    MAX_CELL_XPCT    15        /* Max. Expectation/Category    */
  20. #define    MIN_CELL_XPCT    5        /* Min. Expectation/Category    */
  21. #define    MAX_RUN_CATS    6        /* Max. No. Run Categories    */
  22. #define    DEG_FREE    MAX_RUN_CATS-1    /* Deg. Free in chi-Square    */
  23. #define    NUM_PROBS    100        /* No. ChiSquare Probabilities    */
  24.  
  25. /* ------------------- */
  26. /* FUNCTION PROTOTYPES */
  27. /* ------------------- */
  28. # undef F
  29. # if defined(__STDC__) || defined(__PROTO__)
  30. #    define  F( P )  P
  31. # else
  32. #    define  F( P )  ()
  33. # endif
  34.  
  35. /* INDENT OFF */
  36.  
  37. typedef    struct    RunDataStru
  38.     {
  39.     UINT    NumRand;                /* Number of Variates Desired    */
  40.     long    MaxGenCount;        /* Maximum Generator Count    */
  41.     UINT    ActRandCount;        /* Actual No. Variates Stored    */
  42.     long    ActGenCount;        /* Actual Generator Count    */
  43.     long    TotVariates;        /* Total # Variates - All Runs    */
  44.     long    RunCtrs[7];        /* Run Counters            */
  45.     int    CallStatus;        /* 0 = Failure, 1 = Success    */
  46.     int    (*RandFun) F((void));    /* Address of Generating Fcn.    */
  47.     double    *ChiSqProb;
  48.     int    *RandArray;        /* Address of Receiving Area    */
  49.     }
  50.     RUN_DATA_STRU;
  51.  
  52. extern    void    CountRuns F((RUN_DATA_STRU *));
  53. extern    void    GenerateChiSquareData F((RUN_DATA_STRU *));
  54. extern    void    GenRunData F((RUN_DATA_STRU *));
  55. extern    void    RunMeanStdDev F((UINT, UINT, double *, double *));
  56. extern    void    SetRunControls F((RUN_DATA_STRU *));
  57.  
  58. # undef F
  59. /* INDENT ON */
  60. # endif        /* << __RUNSDEFS_H__ >>    */
  61.